window.addEvent('domready', function(){
	// smooth anchor scrolling
	//new SmoothScroll(); 
	// style area
	if(document.id('gkStyleArea')){
		$$('#gkStyleArea a').each(function(element,index){
			element.addEvent('click',function(e){
	            e.stop();
				changeStyle(index+1);
			});
		});
	}
	// font-size switcher
	if(document.id('gkTools') && document.id('gkComponentWrap')) {
		var current_fs = 100;
		var content_fx = new Fx.Tween(document.id('gkComponentWrap'), { property: 'font-size', unit: '%', duration: 200 }).set(100);
		document.id('gkToolsInc').addEvent('click', function(e){ 
			e.stop(); 
			if(current_fs < 150) { 
				content_fx.start(current_fs + 10); 
				current_fs += 10; 
			} 
		});
		document.id('gkToolsReset').addEvent('click', function(e){ 
			e.stop(); 
			content_fx.start(100); 
			current_fs = 100; 
		});
		document.id('gkToolsDec').addEvent('click', function(e){ 
			e.stop(); 
			if(current_fs > 70) { 
				content_fx.start(current_fs - 10); 
				current_fs -= 10; 
			} 
		});
	}
	// login popup
	if(document.id('gkButtonLogin') && document.id('gkLoginPopup')) {
        var popup_enabled = false;
        var popup_over = false;
        var overlay_opacity = 0.75;
        var overlay = document.id('gkLoginPopupOverlay');
        var overlay_fx = new Fx.Morph(document.id('gkLoginPopupOverlay'), {
            duration: 450,
            transition: Fx.Transitions.Expo.easeInOut
        });
        overlay.fade('out');
        var popup_fx = new Fx.Morph(document.id('gkLoginPopup'), {
            duration: 450,
            transition: Fx.Transitions.Expo.easeInOut
        }).set({'opacity': 0});
        document.id('gkLoginPopupOverlay').addEvent('click', function() {
            (function() {
                if(!popup_over) {
                    popup_enabled = false;
                    popup_fx.start({ 'top': -1000, 'opacity': [1, 0] });
                    overlay_fx.set({ 'height' : window.getSize().y });
                    overlay.fade('out');
                }
            }).delay(100);
        });
        document.id('gkLoginPopup').addEvent('click', function() {
            popup_over = true;
        });
        document.id('gkButtonLogin').addEvent('click', function(e) {
			e.stop();
			document.id('gkLoginPopup').setStyle( 'left', (window.getSize().x - 400) / 2 );
            if(popup_enabled) {
                popup_fx.start({ 'top': -1000, 'opacity': [1,0] });
                overlay_fx.set({ 'height' : window.getSize().y });
                overlay.fade('out');
			} else {
                popup_fx.start({ 'top': 260, 'opacity': [0, 1] });
                overlay_fx.set({ 'height' : window.getSize().y });
                overlay.fade(overlay_opacity);
			}
			popup_enabled = !popup_enabled;
		});
		document.id('gkLoginPopup').addEvents({
            "mouseenter" : function() { popup_over = true; },
            "mouseleave" : function() { popup_over = false; }
		});
	}
});
// function to set cookie
function setCookie(c_name, value, expire) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expire);
	document.cookie=c_name+ "=" +escape(value) + ((expire==null) ? "" : ";expires=" + exdate.toUTCString());
}
// Function to change styles
function changeStyle(style){
	var file1 = $GK_TMPL_URL+'/css/style'+style+'.css';
	var file2 = $GK_TMPL_URL+'/css/typography.style'+style+'.css';
	new Asset.css(file1);
	new Asset.css(file2);
	Cookie.write('gk1_style',style, { duration:365, path: '/' });
}

window.addEvent('domready', function () {

    SqueezeBox.initialize({});
    SqueezeBox.assign($$('a.modal'), {
        parse: 'rel'
    });
});
var K2SitePath = '/gk_penguinmail_quickstart_J25/';
window.addEvent('load', function () {
    new JCaption('img.caption');
});
$GKMenu = { height: true, width: true, duration: 250 };
$GK_TMPL_URL = "http://localhost/gk_penguinmail_quickstart_J25/templates/gk_penguinmail";
function keepAlive() { var myAjax = new Request({ method: "get", url: "index.php" }).send(); } window.addEvent("domready", function () { keepAlive.periodical(840000); });
//<![CDATA[
try { $Gavick; } catch (e) { $Gavick = {}; };
$Gavick["gktab-gkTab-71"] = {
    "activator": "click",
    "animation": 0,
    "animation_speed": 250,
    "animation_interval": 5000,
    "animation_type": "slider",
    "animation_function": Fx.Transitions.linear,
    "active_tab": 1,
    "cookie_save": 0
};
//]]>